Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next
Subject: XMLHttpRequest
Feedback Type: Problem
Product Area: Domino Server
Technical Area: Application Development
Platform: Windows
Release: 8.5.3
Reproducible: Always

I am always getting a XMLHttpRequest.readystate=0 being returned. I have tried without and with the setTimeout method and I can't get the readystate to equal 4. Right now I am just debugging the code with firefox but have same issues in IE.

I hope someone might have a suggestion. Thanks in advance - Mike

My code is as follows:

the onChange event of the MediaType field:
Tdatabase =document.forms[0].path.value; // Accessing Database Name
ObjT1=document.forms[0].MediaType; //Making object of first field
var lanObj = document.getElementById("DisplayLanguage");
keyVal=lanObj.value +"~"+ ProductFamily2.options[ProductFamily2.selectedIndex].text +"~"+ MediaType.options[MediaType.selectedIndex].text ;
ObjT2=document.forms[0].Generations; //Making object of second field
//alert('onChange event');
dbLookup("",Tdatabase,"generations",keyVal,2); //dbLookup (server,database,view,key,column)

the dbLookup function:

/*////////--Dblookup function ---////////*/
var TReq;
function dbLookup(server,database,view,key,column){
var viewurl = "";
server = window.location.hostname;
if( !isNaN(column) )
column -= 1;
viewurl = "https://"+trim(server)+"/"+trim(database)+"/"+view+"?Readviewentries&restricttocategory="+key
if (window.XMLHttpRequest) //for Mozilla
{
TReq = new XMLHttpRequest();
}
else if (window.ActiveXObject) // for IE
{
TReq = new ActiveXObject("Microsoft.XMLHTTP");
}

TReq.onreadystatechange = responseState();
TReq.open("GET", viewurl, true);
TReq.send(null);
}

function responseState()
{ var x = 0
setTimeout( function(){ if (TReq.readyState == 4) // Continue when Response from sever has arrived
{
if (TReq.status == 200) // Continue when everything is ok
{
response = TReq.responseXML;
Mylookup(response)
x == 1
}
}
showAlert();
},5000)

}

function showAlert()
{
var currForm = document.forms[0];
var PF = currForm.ProductFamily2.options[currForm.ProductFamily2.selectedIndex].value;
var MT = currForm.MediaType.options[currForm.MediaType.selectedIndex].value;
alert("Sorry could not get generation list for " + trim2(PF) + "~" + trim2(MT) +". Click the Search button to get all related documents.");
}

/* //// Extract Lookup value form XML data ////*/

function Mylookup(responseXML){
NodeList = responseXML.getElementsByTagName("viewentry")
var strValue="";
var Tsep="";
var strValuesplit = "";
for(var i=0; i<NodeList.length;i++)
{
strValue =strValue+Tsep+NodeList[i].getElementsByTagName("text")[0].childNodes[0].nodeValue
Tsep="¿"
}
strValuesplit = strValue.split("¿")
strValuesplit = sort_unique(strValuesplit)
//alert("Stoping")
generateCombo(strValuesplit,ObjT2)
}

/*//////// Trim Function*/
function trim(str)
{
return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

function trim2(str)
{
return str.replace("%20"," ");
}

/*//Getting value in cobmo Function//*/
function generateCombo(data,inField)
{
inField.length=0
inField.length +=1
inField[inField.length-1].text = "(Select)"
for(vCount=0;vCount<data.length;vCount++)
{
inField.length +=1
strText=data[vCount]
if (strText !=undefined && strText != null)
{
inField[inField.length-1].text = trim(strText)
}
}
}


Feedback number WEBB9KSLM4 created by ~Joan Kijumimar on 06/05/2014

Status: Open
Comments:





Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS